package cn.xu.tool.big.a;

import cn.xu.tool.big.a.compments.KlineCp;
import cn.xu.tool.big.a.compments.TextReport;
import cn.xu.tool.big.a.compments.transaction.TransactionCp7;
import cn.xu.tool.big.a.compments.transaction.TransactionDialogHalfCp;
import cn.xu.tool.big.a.compments.transaction.TransactionHalfCp;
import cn.xu.tool.big.a.dto.KLine;
import cn.xu.tool.big.a.dto.TotalReturn;
import cn.xu.tool.big.a.dto.TradeRecord;

import java.util.ArrayList;
import java.util.List;

/**
 * 类名: TransactionMain
 * 描述: TODO
 * 作者: ClarkXu clark2021@qq.com
 * 日期: 2025/7/14
 */
public class TransactionMain_002120 {

    public static void main(String[] args) throws Exception {
        String startDate = "202404180945";
        String endDate = "202507181500";
        String stockCode = "sz002120";
        double initialCapital = 100000; // 初始资金10万
        double commissionRate = 0.0001354; // 佣金率1.354/万
        TotalReturn totalReturn = new TotalReturn();

        List<KLine> kLines = KlineCp.readKlineNow(stockCode, startDate, endDate, "15m");
//        List<TradeRecord> tradeRecords = TransactionCp6.doTransactionBt(kLines,  initialCapital, commissionRate, totalReturn,
//                1, 3, 0.99, 1.01);
        List<TradeRecord> tradeRecords = new ArrayList<>();
        TransactionDialogHalfCp.doTransactionBt(kLines,
                initialCapital, 0, 0, 0,
                commissionRate, totalReturn,
                1, 3, 0.99, 1.01, 1.05, 0.97, false, false, tradeRecords);
        TextReport.saveTextReport(kLines, tradeRecords, stockCode, startDate, endDate, totalReturn);
//        CombinedReportCp.createCombinedReport(tradeRecords, totalReturn, kLines, stockCode, startDate, endDate);
    }
}
